/*
 * author      : 吴中勤
 * date        : 2018/6/27
 * description : 基类 dto
 */

package com.deepexi.adapter.common;


import com.google.gson.GsonBuilder;

public class BaseDto {
    @Override
    public String toString() {
        return new GsonBuilder()
                .setDateFormat(DateUtils.DEFALUT_TIMESTAMP_FORMAT)
                .create()
                .toJson(this);
    }

    public String beautify() {
        return new GsonBuilder()
                .setDateFormat(DateUtils.DEFALUT_TIMESTAMP_FORMAT)
                .setPrettyPrinting()
                .create()
                .toJson(this);
    }

    public String uglyString() {
        return new GsonBuilder()
                .setDateFormat(DateUtils.DEFALUT_TIMESTAMP_FORMAT)
                .create()
                .toJson(this);
    }
}
